<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0,
		minimum-scale=1.0, maximum-scale=1.0"/>
    <meta charset="UTF-8">
    <title>发票详情</title>
    <link href="../public/css/style.css" rel="stylesheet">
    <link href="../public/css/common.css" rel="stylesheet">
</head>
<body class="layout_body">
<div class="layout_content graybg"  style="padding-bottom: 0;">
    <header class="demo-header" style="padding-top: 10px;">
        <div class="titleLeft flt">
            <a href="index.html">
                <img src="../public/img/back.png" width="35px" height="33px">
            </a>
        </div>
        <div class="titleRight flt text-center">发票详情</div>
    </header>
    <div class="whitebg">
        <div class="sizecolor">
            <?php
                if ($invoiceDate['head'][0]['label'] || $invoiceDate['head'][0]['label'] ){
                    echo $invoiceDate['head'][0]['label'].':'.$invoiceDate['head'][0]['value'];
                }
            ?>
        </div>
        <div class="message-detail" id="invdetail">
            <?php if ($invoiceDate['body']){ ?>
                <?php foreach ($invoiceDate['body'] as $key => $body){ ?>
                    <p><?php echo $body['label']?>：<span><?php echo $body['value']?></span></p>
                <?php } ?>
            <?php } ?>
        </div>
    </div>
    <?php if (isset($invoiceDate['foot'])){ ?>
        <div class="whitebg" style="position: fixed;bottom: 0;width: 100%;">
            <div class="padding-adjust4 border1">
                <a>
                    <div class="button-two Cgray affirm_invoice" invoice_id="<?php  echo $invoiceDate['invoice_id'];?>">
                        <?php
                            if ($invoiceDate['foot'][0]['title']){
                                echo $invoiceDate['foot'][0]['title'];
                            }
                        ?>
                    </div>
                </a>
            </div>
        </div>
    <?php } ?>
</div>
</body>
<script>
    $('body').on('click','.affirm_invoice',function () {
        var invoice_id = parseInt($(this).attr('invoice_id'));
        $.ajax({
            url: '/ajax/Invoice/',
            type: 'post',
            dataType: 'json',
            data:{
                'ajaxdata':'update',
                'invoice_id':invoice_id
            },
            success: function (response) {
                layer.msg(response.msg);
                window.location = "/invoice/index";
            },
            beforeSend: function () {
            }
        });
    });
</script>
</html>
